import 'package:FlutterDemo/common/commons.dart';
import 'package:flutter/material.dart';
import 'package:kasax/kasax.dart';

class Plugin2ParticalWidget extends StatefulWidget {
  const Plugin2ParticalWidget({Key? key}) : super(key: key);

  @override
  _Plugin2ParticalWidgetState createState() => _Plugin2ParticalWidgetState();
}

class _Plugin2ParticalWidgetState extends State<Plugin2ParticalWidget> {
  var msg = "";

  @override
  void initState() {
    super.initState();
    Kasax.platformVersion.then((value) {
      setState(() {
        msg = value!;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Text("msg: $msg"),
          buildCommonRaisedButton("测试长Toast", 20.0, () {
            Kasax.showShortToast("测试长Toast");
          }),
          buildCommonRaisedButton("测试短Toast", 20.0, () {
            Kasax.showShortToast("测试短Toast");
          }),
        ],
      ),
    );
  }
}
